<template>
    <div>
        <MBX
            level="权限管理"
            level2="权限列表"
        ></MBX>
        <br>
        <el-card>
            <el-table
                :data="rights"
                :border="true"
            >
                <el-table-column
                    label="#"
                    type="index"
                ></el-table-column>
                <el-table-column
                    label="权限名称"
                    prop="authName"
                ></el-table-column>
                <el-table-column
                    label="路径"
                    prop="path"
                ></el-table-column>
                <el-table-column label="权限等级">
                    <template slot-scope="scope">
                        <div>
                            <el-tag v-if="scope.row.level==0">一级权限</el-tag>
                            <el-tag
                                v-else-if="scope.row.level==1"
                                type="success"
                            >二级权限</el-tag>
                            <el-tag
                                v-else
                                type="info"
                            >三级权限</el-tag>
                        </div>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
    </div>
</template>

<script>
export default {
  data() {
    return {
      rights: []
    };
  },
  created() {
    this.xr();
  },
  methods: {
    async xr() {
      let res = await this.$API.juesequanxian("list");
      console.log("权限列表", res);
      this.rights = res;
    }
  }
};
</script>

<style scoped >
</style>
